﻿@model GameSchool.ViewModels.ViewGameViewModel
@{
	ViewBag.Title = @Model.Game.Name;
}

<!--Brauðmolar-->
<ul class="breadcrumb">  
	<li><a href="/Home">Forsíða</a> <span class="divider">></span></li>  
	<li><a href="/Game/Games">Leikir</a> <span class="divider">></span></li>
	<li class="active">@Model.Game.Name</li>
</ul>


<!--Lýsing leiks og helstu upplýsingar-->
<h2>@Model.Game.Name</h2>
<hr />
<h4>@Model.Game.Description</h4>
<hr />
<br />




<!--Flipar-->
<div class="tabbable">
	<ul class="nav nav-tabs">
		<li class="active"><a href="#tab1" data-toggle="tab">Tilkynningar</a></li>
		<li><a href="#tab2" data-toggle="tab">Borð</a></li>
		<li><a href="#tab3" data-toggle="tab">Verkefni</a></li>
		@*<li><a href="#tab4" data-toggle="tab">Netpróf</a></li>*@ <!--Þessi virkni er ekki klár-->
		<li><a href="#tab5" data-toggle="tab">Myndbönd</a></li>
		<li><a href="#tab6" data-toggle="tab">Stigatafla</a></li>
		<li><a href="#tab7" data-toggle="tab">Nemendur</a></li>
	</ul>
<!--Flipar enda-->

<!--Efni á bak við flipa-->
	<div class="tab-content">
		<div class="tab-pane active" id="tab1">
		@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
		{
			<a class="btn btn-primary offset3" href="/Announcement/CreateAnnouncement/@Model.Game.ID">Skrá tilkynningu</a>
			<br />
			<br />
		}
		
			
			

			@foreach (var n in Model.Announcements)
   {
				<table class="table">
					<tbody>
						<tr>
							<td><h3>@n.Title</h3>
							<h6>@n.Date</h6>
							<div class="well">
								<p>@n.Announcements</p> 
							</div>
							</td>
						</tr> 
					</tbody>
				</table>
   }
		</div>
		<div class="tab-pane" id="tab2">
			@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
			{
				<a class="btn btn-primary offset3" href="/Level/CreateLevel/@Model.Game.ID">Skrá borð</a>
			}
			
		<table class="table tables table-striped">
			<thead>
				<tr>
					<th>Borð</th>
					<th>Lýsing</th>
					<th>Skil</th>
					<th>Stig</th>
					@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
	 {	
						<th>Breyta</th>
	 }
				</tr>
			</thead>
				<tbody>
					@foreach (var n in Model.Levels)
	 {
						<tr>
							<td><a href="/Level/ViewLevel/@n.ID">@n.Title</a></td>
							<td>@n.Description</td>
							<td>Hér kemur progressbar</td>
							<td>Stigin</td>
							@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
							{	
								<td><a href="/Level/editLevel/@n.ID"> <i class="icon-wrench"></i></a></td>
							}
						</tr>
	 }
				</tbody>
			  </table>
			
			

		</div>
		<div class="tab-pane" id="tab3">
		@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
  {	
			<a class="btn btn-primary offset3" href="/Assignment/CreateAssignment/@Model.Game.ID">Skrá nýtt verkefni</a>
  }

			<table class="table tables table-striped">
				<thead>
					<tr>
						<th>Titill</th>
						<th>Skilafrestur</th>
						@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
						{
							<th>Breyta</th>
						}
						 
						@*<th>Einkunn</th>
						<th>Stig</th>*@
					</tr>
				</thead>
					<tbody>				
						@foreach (var n in Model.Assignments)
	  {
							<tr>
								<td><a href="/Assignment/ViewAssignment/@n.ID">@n.Title</a></td>
								<td>@n.Deadline</td>
								@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
		{
									<td><a href="/Assignment/EditAssignment/@n.ID"> <i class="icon-wrench"></i></a></td>
		}
							</tr>
	  }
					</tbody>
			  </table>
		</div>
		@*Netprófin verða að bíða :/
		<div class="tab-pane" id="tab4">
			<p>Howdy, I'm in Section 4.</p>
		</div>*@
		<div class="tab-pane" id="tab5">
		@if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
		{ 
			<a class="btn btn-primary offset3" href="/Video/CreateVideo/@Model.Game.ID">Skrá nýtt myndband</a>
		}
		
		<table class="table tables table-striped">
				<thead>
					<tr>
						<th>Titill</th>
					</tr>
				</thead>
					<tbody>				
						@foreach (var n in Model.Videos)
	  {
							<tr>
								<td><a href="/Video/ViewVideo/@n.ID">@n.Title</a></td>
							</tr>
	  }
					</tbody>
			  </table>
		</div>
		<div class="tab-pane" id="tab6">
			@if (User.IsInRole("Student") && Model.myPoints != null)
			{
				<h2>Hér eru upplýsingar um stig þín</h2>
				<p>Þú ert með <strong>@Model.myPoints.CurrentPoints</strong> stig. <br /> 
				Alls hefur unnið þér inn <strong>@Model.myPoints.TotalPoints</strong> stig.</p>
			}
			else if (User.IsInRole("Admin") || User.IsInRole("Teacher"))
			{
			   @*<h2>Topp stigalisti allra nemanda skólans</h2>*@
				<table class="table tables table-striped">
				<thead>
					<tr>
						<th>Nemandi</th>
						<th>Stig</th>
					</tr>
				</thead>
					<tbody>
				@foreach (var n in Model.allUserPoints)
				{
					<tr>
						<td>@n.UserName</td>
						<td>@n.TotalPoints</td>
					</tr>
				}
				</tbody>
			  </table>
			}
		</div>
		<div class="tab-pane" id="tab7">
			<p><strong>Hér kemur listi yfir alla þá nemendur sem eru í námskeiðinu</strong></p>
			<ul>
			@foreach (var n in Model.Students)
			{
				<li>@n.PropertyValuesString</li>
				<br />
			}
			</ul>
		</div>
	</div>
</div>
<!--Efni á bak við flipa endar-->
